package week6;

import java.io.*;

/**
 * @author The Setting sun
 * @create 2021-10-14 14:56
 */
public class Work2 {
    public static void main(String[] args) throws IOException {
        File file1 = new File("D:\\worktest\\t1");
        File file2 = new File("D:\\worktest\\t2");

        file1.mkdirs();
        file2.mkdir();

        File file3 = new File(file1, "test1.txt");
        FileWriter fr = new FileWriter(file3);
        fr.write("Java学习方案");
        fr.close();

        File file4 = new File(file2, "test2.txt");
        file3.renameTo(file4);

    }
}
